package com.tn.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Suzuki
 * @CreateTime: 2022-07-26  09:24
 * @Description: TODO
 * @Version: 1.0
 **/
@Configuration
public class MinIoClientConfig {

    @Value("${file.minio.endpoint}")
    private String endpoint;
    @Value("${file.minio.access-key}")
    private String accessKey;
    @Value("${file.minio.secret-key}")
    private String secretKey;


    @Bean
    public MinioClient minioClient(){

        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(accessKey, secretKey)
                .build();
    }


}
